import 'package:boss/ui/widget/button/fixed_bottom_btn.dart';
import 'package:boss/ui/widget/timeRangePicker/provider/time_range_picker_provider.dart';
import 'package:boss/ui/widget/timeRangePicker/widget/time_range_picker_view.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class TimeRangePickerBrowser extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
        top: 68.w,
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          TimeRangePickerView(),
          FixedBottomBtn(
            title: '保 存',
            isShowShadow: false,
            onTap: () {
              var provider = Provider.of<TimeRangePickerProvider>(context, listen: false,);
              if (provider.startTime == null || provider.endTime == null) {
                toast('请选择时间');
                return;
              }

              Navigator.pop(context, [provider.startTime, provider.endTime]);
            },
          ),
        ],
      ),
    );
  }
}
